# coding: utf-8
from sqlalchemy import Column, DateTime, Integer, String
from sqlalchemy.schema import FetchedValue
from flask_sqlalchemy import SQLAlchemy
from application import db


class Person(db.Model):
    __tablename__ = 'person'

    sap = db.Column(db.Integer, primary_key=True)
    companyid = db.Column(db.Integer)
    departmentid = db.Column(db.Integer)
    area = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    company = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    companyname1 = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    companyname2 = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    department = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    aboveid = db.Column(db.Integer)
    above = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    dfunction = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    postid = db.Column(db.Integer)
    post = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    pfunction = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    name = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    hrclass = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    ist = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    isleader = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    sex = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    college = db.Column(db.TEXT)
    iscollege = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    bestcollege = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    firstcollege = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    collegeclass = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    groupdate = db.Column(db.Date)
    companydate = db.Column(db.Date)
    workdate = db.Column(db.Date)
    leavedate = db.Column(db.Date)
    workage = db.Column(db.Integer)
    month = db.Column(db.Integer)
    key = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    englishtext = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    title = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    or1 = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    or2 = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    isboss = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    group = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    songroup = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    monygroup = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    idnum = db.Column(db.String(50, 'utf8mb4_0900_ai_ci'))
    birthday = db.Column(db.Date)
    age = db.Column(db.Integer)
    constellation = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    employstart = db.Column(db.Date)
    employyear = db.Column(db.Integer)
    employend = db.Column(db.Date)
    tryenddate = db.Column(db.Date)
    year = db.Column(db.Integer)
    gwxl = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    hrrange = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    sonhrrange = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    issecret = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    fileid = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    employway = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    experience = db.Column(db.TEXT)
    phone = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    oa = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    mail = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    oseaexperience = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    oscollege = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    homeland = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    householdtype = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    household = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    nation = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    politics = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    marriage = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    address = db.Column(db.TEXT)
    tall = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    photo = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    bettertype = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    better = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    interest = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    major = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    hrfile = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    ispublic = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    isproperty = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))
    propertytype = db.Column(db.String(100, 'utf8mb4_0900_ai_ci'))

    # work_list = db.relationship('WorkList', backref='user')
    # # work_list = db.relationship('WorkList', primaryjoin="or_(User.id==WorkList.createuid, User.id==WorkList.uid)",
    # #                           lazy='dynamic')
    # # repr()方法显示一个可读字符串
    def __repr__(self):
        return '%s' % self.name
